//package org.example;
//
//import org.example.entity.CustomerInfo;
//import org.example.entity.CustomerOrder;
//import org.example.entity.CustomerRepayPlan;
//import org.example.generator.DataGenerator;
//
//import java.time.LocalDate;
//import java.util.List;
//
///**
// * Simple test for Vintage and Migration Rate functionality
// */
//public class SimpleVintageTestEn {
//    public static void main(String[] args) {
//        System.out.println("=== Simple Test for Vintage and Migration Rate ===");
//
//        // Test product name distribution by time
//        System.out.println("\n=== Product Name Test ===");
//        LocalDate date2023 = LocalDate.of(2023, 8, 15);
//        LocalDate date2024 = LocalDate.of(2024, 3, 15);
//
//        System.out.println("2023-08 Product: " + DataGenerator.getProductNameByDate(date2023));
//        System.out.println("2024-03 Product: " + DataGenerator.getProductNameByDate(date2024));
//
//        // Test generating repayment plans with overdue logic
//        System.out.println("\n=== Repayment Plan Overdue Test ===");
//        CustomerInfo customer = DataGenerator.generateCustomerInfo(date2023);
//        CustomerOrder order = DataGenerator.generateCustomerOrder(customer, date2023, "Test");
//        List<CustomerRepayPlan> plans = DataGenerator.generateRepayPlan(order);
//
//        System.out.println("Order No: " + order.getOrderNo());
//        System.out.println("Product Name: " + order.getProductName());
//        System.out.println("Loan Amount: " + order.getLoanAmount());
//        System.out.println("Repayment Terms: " + plans.size());
//
//        // Count overdue situations
//        int overdueCount = 0;
//        int totalOverdueDays = 0;
//
//        System.out.println("\nRepayment Plan Details:");
//        for (CustomerRepayPlan plan : plans) {
//            System.out.printf("Term %d: Due Date=%s, Status=%s, Overdue Days=%d, Amount=%s\n",
//                    plan.getBillTenor(),
//                    plan.getDueDate(),
//                    plan.getRepayStatus(),
//                    plan.getOverdueDays(),
//                    plan.getNowPayAmount());
//
//            if (plan.getOverdueDays() > 0) {
//                overdueCount++;
//                totalOverdueDays += plan.getOverdueDays();
//            }
//        }
//
//        System.out.printf("\nOverdue Stats: %d terms overdue, Total overdue days: %d\n", overdueCount, totalOverdueDays);
//
//        // Test migration rate
//        System.out.println("\n=== Migration Rate Test ===");
//        int m1Count = 0, m2Count = 0, m3Count = 0, m4Count = 0, m5Count = 0, m6Count = 0;
//
//        for (CustomerRepayPlan plan : plans) {
//            if (plan.getOverdueDays() > 0) {
//                if (plan.getOverdueDays() <= 30) m1Count++;
//                else if (plan.getOverdueDays() <= 60) m2Count++;
//                else if (plan.getOverdueDays() <= 90) m3Count++;
//                else if (plan.getOverdueDays() <= 120) m4Count++;
//                else if (plan.getOverdueDays() <= 150) m5Count++;
//                else m6Count++;
//            }
//        }
//
//        System.out.printf("M1(0-30 days): %d terms\n", m1Count);
//        System.out.printf("M2(31-60 days): %d terms\n", m2Count);
//        System.out.printf("M3(61-90 days): %d terms\n", m3Count);
//        System.out.printf("M4(91-120 days): %d terms\n", m4Count);
//        System.out.printf("M5(121-150 days): %d terms\n", m5Count);
//        System.out.printf("M6(150+ days): %d terms\n", m6Count);
//
//        if (m1Count > 0) {
//            System.out.printf("M1->M2 Migration Rate: %.1f%%\n", (double) m2Count / m1Count * 100);
//        }
//        if (m2Count > 0) {
//            System.out.printf("M2->M3 Migration Rate: %.1f%%\n", (double) m3Count / m2Count * 100);
//        }
//    }
//}
